<?php

namespace App\Providers;

use Illuminate\Http\Request;
use Illuminate\Support\Arr;
use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     */
    public function register(): void
    {
        //
    }

    /**
     * Bootstrap any application services.
     */
    public function boot(): void
    {
        // 扩展请求类
        Request::macro('postWithOutKeys', function($keys=['_token']) {
            /**
             * @var Request $this
             */
            $results = $this->post();
            Arr::forget($results, $keys);

            return $results;
        });
        
    }
}
